//package com.example.user.controller;
//
//import com.example.user.service.SecKill_redis;
//import org.springframework.stereotype.Controller;
//
//import java.io.IOException;
//import java.util.Random;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebInitParam;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * 秒杀案例
// */
//@WebServlet(value = "/mshd",initParams = {@WebInitParam(name="prodid",value="101")})
//@Controller
//public class SecKillServlet extends HttpServlet {
//    private static final long serialVersionUID = 1L;
//
//    public SecKillServlet() {
//        super();
//    }
//
//    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        String userid = new Random().nextInt(50000) +"" ;
//        String prodid =getServletConfig().getInitParameter("prodid");
//
//        //boolean isSuccess=SecKill_redis.doSecKill(userid,prodid);
//        boolean isSuccess= SecKill_redis.doSecKill(userid,prodid);
//        response.getWriter().print("结果"+isSuccess);
//    }
//
//}
//
